\documentclass[a4paper,12pt,oneside,reqno,openbib]{book}%
\usepackage{amsmath}%
\usepackage{amsfonts}%
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{amssymb}%
\usepackage{tikz}
\usetikzlibrary{positioning,shapes,shadows,arrows}
\usepackage{graphicx}%
\usepackage{xcolor}
\usepackage{epstopdf}
\usepackage[final]{pdfpages} % http://de.wikibooks.org/wiki/LaTeX-W%C3%B6rterbuch:_includepdf
\pdfoptionpdfminorversion=5 % eleminate: PDF inclusion: found PDF version <1.5>, but at most version <1.4> allowed
\usepackage[plainpages=false]{hyperref}
%----------------------------------------------------------
%hyperref setup:
\hypersetup{
  %bookmarks=true,        % show bookmarks bar?
  unicode=true,          % non-Latin characters in Acrobatï¿œs bookmarks
  pdftoolbar=true,        % show Acrobat's toolbar?
  pdfmenubar=true,        % show Acrobat's menu?
  pdffitwindow=false,     % window fit to page when opened
  pdfstartview={FitH},    % fits the width of the page to the window
  pdftitle={PAIND Bilderverarbeitung auf GPU},    % title
  pdfauthor={Klemens Imholz},     % author
  pdfsubject={PAIND at the Lucerne University of Applied Sciences and Arts},   % subject of the document
  pdfcreator={Klemens Imholz},   % creator of the document
  pdfproducer={Klemens Imholz}, % producer of the document
  pdfkeywords={BDA,} {Lucerne University of Applied Sciences and Arts,} {PC Programming}, % list of keywords
  pdfnewwindow=true,      % links in new window
  colorlinks=true,        % false: boxed links; true: colored links
  linkcolor=blue,          % color of internal links
  citecolor=blue,        % color of links to bibliography
  filecolor=blue,      % color of file links
  urlcolor=blue           % color of external links
}
%----------------------------------------------------------


\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[scale=0.8,every node/.style={minimum size=1cm},on grid]

\definecolor{r100}{rgb}{1.00,1.00,0};

% macros
\newcommand{\pixel}[3] % x, y, color
{	\fill[#3] (#1*.4+.05, #2*.4+.05) rectangle (#1*.4+.35, #2*.4+.35); }

\newcommand{\basegrid}[2] % width, height
{ %	\draw[step=4mm, black] (0,0) grid (#1*0.4, #2*0.4);
	\pgfmathsetmacro{\ymax}{#2-1};
	\pgfmathsetmacro{\xmax}{#1-1};
	\foreach \y in {0, ..., \ymax}{
	 \foreach \x in {0, ..., \xmax}{
	 	\pixel{\x}{\y}{black}; } } }

\newcommand{\filter}[3] % pos X, pos Y, size
{	\pgfmathsetmacro{\soy}{(#2*.4}; % scaled origin y
	\pgfmathsetmacro{\sox}{(#1*.4}; % scaled origin x
	\pgfmathsetmacro{\shs}{(#3-1)/2*.4}; % scaled half size
	\draw[blue,ultra thick] (\sox-\shs,\soy-\shs) rectangle (\sox+.4+\shs,\soy+.4+\shs);
	\pixel{#1}{#2}{white};}
	
\newcommand{\caco}[3] % colorCalculat: calculate new color
% base color weight rgb 1,0.5, 0
{	\pgfmathsetmacro{\rc}{#1*.01}; % red channel
	\pgfmathsetmacro{\gc}{#2*.01}; % green channel
	\pgfmathsetmacro{\bc}{#3*.00}; % blue channel
	\definecolor{cuco}{rgb}{\rc,\gc,\bc}; % define current color
}

% scopes
\begin{scope}[
	yshift=0,every node/.append style={
	yslant=0.5,xslant=-1},yslant=0.5,xslant=-1]
	
	\basegrid{23}{9}
%	\filter{10}{4}{3};
	
	% char H		
	\foreach \y in {1, ..., 7}
	{	\pixel{1}{\y}{r100}; }
	\foreach \x in {2, ..., 4}
	{	\pixel{\x}{4}{r100}; }
	\foreach \y in {1, ..., 7}
	{	\pixel{5}{\y}{r100}; }
	
	% char S
	\foreach \x in {7, ..., 9}
	{	\pixel{\x}{1}{r100}; }
	\pixel{10}{2}{r100};
	\pixel{10}{3}{r100};
	\pixel{9}{4}{r100};
	\pixel{8}{4}{r100};
	\pixel{7}{5}{r100};
	\pixel{7}{6}{r100};
	\foreach \x in {8, ..., 10}
	{	\pixel{\x}{7}{r100}; }
	
	% char L
	\foreach \y in {1, ..., 7}
	{	\pixel{12}{\y}{r100}; }
	\foreach \x in {12, ..., 15}
	{	\pixel{\x}{1}{r100}; }
	
	% char U
	\foreach \y in {2, ..., 7}
	{	\pixel{17}{\y}{r100}; }
	\foreach \x in {18, ..., 20}
	{	\pixel{\x}{1}{r100}; }
	\foreach \y in {2, ..., 7}
	{	\pixel{21}{\y}{r100}; }
	
	\draw[thick,black] (3.5,-.5) node {Source Image};
	
\end{scope}


% scopes
\begin{scope}[
	yshift=-130,every node/.append style={
	yslant=0.5,xslant=-1},yslant=0.5,xslant=-1]
	
%	\basegrid{23}{9}
	
	
	% draw source image

	
	\draw[thick,black] (3.5,-.5) node {changes};
	
\foreach \x/\c in{0/3,1/11,2/3,3/0,4/3,5/11,6/3,7/3,8/14,9/17,10/14,11/6,12/11,13/3,14/0,15/0,16/3,17/11,18/3,19/0,20/3,21/11,22/3}
{
  \caco{\c}{\c}{\c};
  \pixel{\x}{8}{cuco};
}
\foreach \x/\c in{0/14,1/55,2/14,3/0,4/14,5/55,6/17,7/22,8/58,9/66,10/55,11/25,12/55,13/14,14/0,15/0,16/14,17/55,18/14,19/0,20/14,21/55,22/14}
{
  \caco{\c}{\c}{\c};
  \pixel{\x}{7}{cuco};
}
\foreach \x/\c in{0/17,1/66,2/17,3/0,4/17,5/66,6/31,7/58,8/28,9/17,10/14,11/20,12/66,13/17,14/0,15/0,16/17,17/66,18/17,19/0,20/17,21/66,22/17}
{
  \caco{\c}{\c}{\c};
  \pixel{\x}{6}{cuco};
}
\foreach \x/\c in{0/17,1/69,2/31,3/17,4/31,5/69,6/31,7/58,8/28,9/14,10/3,11/17,12/66,13/17,14/0,15/0,16/17,17/66,18/17,19/0,20/17,21/66,22/17}
{
  \caco{\c}{\c}{\c};
  \pixel{\x}{5}{cuco};
}
\foreach \x/\c in{0/17,1/77,2/72,3/66,4/72,5/77,6/20,7/22,8/58,9/58,10/22,11/20,12/66,13/17,14/0,15/0,16/17,17/66,18/17,19/0,20/17,21/66,22/17}
{
  \caco{\c}{\c}{\c};
  \pixel{\x}{4}{cuco};
}
\foreach \x/\c in{0/17,1/69,2/31,3/17,4/31,5/69,6/17,7/3,8/14,9/28,10/58,11/31,12/66,13/17,14/0,15/0,16/17,17/66,18/17,19/0,20/0,21/100,22/0}
{
  \caco{\c}{\c}{\c};
  \pixel{\x}{3}{cuco};
}
\foreach \x/\c in{0/0,1/100,2/0,3/0,4/0,5/100,6/0,7/0,8/0,9/0,10/100,11/0,12/100,13/0,14/0,15/0,16/0,17/100,18/0,19/0,20/0,21/100,22/0}
{
  \caco{\c}{\c}{\c};
  \pixel{\x}{2}{cuco};
}
\foreach \x/\c in{0/0,1/100,2/0,3/0,4/0,5/100,6/0,7/100,8/100,9/100,10/0,11/0,12/100,13/100,14/100,15/100,16/0,17/0,18/100,19/100,20/100,21/0,22/0}
{
  \caco{\c}{\c}{\c};
  \pixel{\x}{1}{cuco};
}
\foreach \x/\c in{0/0,1/0,2/0,3/0,4/0,5/0,6/0,7/0,8/0,9/0,10/0,11/0,12/0,13/0,14/0,15/0,16/0,17/0,18/0,19/0,20/0,21/0,22/0}
{
  \caco{\c}{\c}{\c};
  \pixel{\x}{0}{cuco};
}
	
	\filter{19}{3}{3};

	
\end{scope}


%
% draw annotations
%


%
\end{tikzpicture}
\end{document} 
